<template>
  <div class="home">
    <h1>home--骨架屏</h1>
    <!-- 中间logo -->
    <div class="image"></div>
    <div class="title"></div>
    <div class="btns">
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
    </div>
    <div class="footer">
      <div class="btn"></div>
      <div class="btn"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Skeleton',
  components: {},
  data() {
    return {};
  },
  mounted() {},
  methods: {},
};
</script>

<style lang="scss" scoped>
.home {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .image {
    width: 200px;
    height: 200px;
    background-color: #ededed;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 60%
      )
      #ededed;
    background-size: 200% 100%;
    background-position-x: 180%;
    animation: 1s loading ease-in-out infinite;
  }
  .title {
    margin-top: 4px;
    width: 112px;
    height: 23px;
    background-color: #ededed;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 60%
      )
      #ededed;
    background-size: 200% 100%;
    background-position-x: 180%;
    animation: 1s loading ease-in-out infinite;
  }
  .btns {
    display: flex;
    flex-direction: row;
    margin-top: 4px;
    .item {
      width: 88px;
      height: 44px;
      background-color: #ededed;
      background: linear-gradient(
          100deg,
          rgba(255, 255, 255, 0) 40%,
          rgba(255, 255, 255, 0.5) 50%,
          rgba(255, 255, 255, 0) 60%
        )
        #ededed;
      background-size: 200% 100%;
      background-position-x: 180%;
      animation: 1s loading ease-in-out infinite;
    }
  }
  .footer {
    width: 100vw;
    position: fixed;
    bottom: 0;
    left: 0;
    height: 50px;
    border: 1px solid #ededed;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    .btn {
      width: 40px;
      height: 40px;
      background-color: #ededed;
      background: linear-gradient(
          100deg,
          rgba(255, 255, 255, 0) 40%,
          rgba(255, 255, 255, 0.5) 50%,
          rgba(255, 255, 255, 0) 60%
        )
        #ededed;
      background-size: 200% 100%;
      background-position-x: 180%;
      animation: 1s loading ease-in-out infinite;
    }
  }
}
@keyframes loading {
  to {
    background-position-x: -20%;
  }
}
</style>
